@echo off
rem
rem This info came from net start
rem  should probably make this into a script that generates and executes the commands.
rem
rem net stop "SQL Server Agent (FRED)"
rem net stop "SQL Server Analysis Services (FRED)"
rem net stop "SQL Server Browser"
rem net stop "SQL Server Integration Services 10.0"
rem net stop "SQL Server Reporting Services (FRED)"
rem net stop "SQL Server VSS Writer"
rem net stop "SQL Server (FRED)"


for /f "usebackq delims==" %%i in (`net start`) do call :startservice %%i
goto :eof

for /f "usebackq delims==" %%i in (` ( net start | find /i "sql server" )`) do net stop %%i
| find /i "sql server"
net stop %%i

:startservice 
echo %* | find /i "sql server" && net stop "%*"
goto :eof